TARGET = ftl

DIRS = . st1 st3 st3c sh gc cmn test
IDIR = $(foreach d, $(DIRS), -I$d)

SRC += $(foreach dir, $(DIRS), $(wildcard $(dir)/*.cc))

CXX = g++
CXXFLAGS = -I$(IDIR)
CXXFLAGS += -g -O0
CXXFLAGS += -Iinclude
CFLAGS += -Wall
SCPATH = /opt/systemc-2.3.4
LIBS = -lm

$(TARGET): $(SRC)
	$(CXX) $(CXXFLAGS) $(LDFLAGS) -I$(SCPATH)/include -L. -L$(SCPATH)/lib -Wl,-rpath $(SCPATH)/lib $^ $(LIBS) -o $@ -lsystemc

clean:
	$(RM) $(TARGET)
